<!-- This page is for editing Family In Need Info-->

<?php 
$page_title="Family Information";
require_once('../auth/auth.php');
include('templates/header.php'); 

$family_id = $_GET['family_id'];



// Accesses database                                    
 include 'db/db_Connect.php';
 	$user_id = $_SESSION['SESS_USER_ID'];
 	//$result = mysql_query("SELECT * from User WHERE user_id = '$user_id'");
	//$user = mysql_fetch_array($result);

	$result = mysql_query("SELECT * from Families WHERE family_id = '$family_id'");
	$family = mysql_fetch_array($result);
 
	$member1Result = mysql_query("SELECT * from FamilyMembers WHERE family_id = '$family_id' AND contact_1='1'");
	$member1 = mysql_fetch_array($member1Result);
	
	$member2Result = mysql_query("SELECT * from FamilyMembers WHERE family_id = '$family_id' AND contact_2='1'");
	$member2 = mysql_fetch_array($member2Result);
	
 include 'db/db_Close.php';    
?>


			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-user"></i> Family Information</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						</div>
					</div>
					<div class="box-content">
			<form class="form-horizontal" name="updateProfileForm" action="db/updateFamilyInformationDB.php" method="post">
							<fieldset>
							<legend>General Family Information</legend>					  
								<!-- Apartment Number-->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">Apartment #</label>
										<div class="controls">
										  <input name="apt_number" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['apt_number']; ?>">
										</div>
									  </div>	
								<!-- Street Address -->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">Street Address</label>
										<div class="controls">
										  <input name="street_address" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['street_address']; ?>">
										</div>
									  </div>		
								<!-- City -->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">City</label>
										<div class="controls">
										  <input name="city" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['city']; ?>">
										</div>
									  </div>							  
								<!-- State -->							
										<div class="control-group">
										  <label class="control-label" for="typeahead">State</label>
										  <div class="controls">
											<input name="state" type="text" class="span6 typeahead" id="typeahead" value="<?php echo $family['state']; ?>" data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
										  </div>
										</div>
								<!-- Zipcode -->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">Zipcode</label>
										<div class="controls">
										  <input name="zipcode" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['zipcode']; ?>">
										</div>
									  </div>  						
								<!-- SEPERATOR-->
									<div class="control-group"> </div>
								<!-- # of Adults-->
									<div class="control-group">
											<label class="control-label" for="focusedInput">No. of Adults</label>
										<div class="controls">
										  <input name="num_adults" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['num_adults']; ?>">
										</div>
									</div>
								<!-- # of children-->
									<div class="control-group">
											<label class="control-label" for="focusedInput">No. of children</label>
										<div class="controls">
										  <input name="num_children" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $family['num_children']; ?>">
										</div>
									  </div>
								<!-- Not apply other agency-->		
								  <div class="control-group">
									<label class="control-label">Do you agree NOT to apply to any other agency for a Christmas basket?</label>
									<div class="controls">
									  <label class="radio">
										<input name="other_agency" type="radio" id="other_agency1" value="1" <?php if($family['other_agency'] == '1'){ echo "checked=''";} ?>>
											Yes
									  </label>
									  <div style="clear:both"></div>
									  <label class="radio">
										<input type="radio" name="other_agency" id="other_agency2" value="0" <?php if($family['other_agency'] == '0'){ echo "checked=''";} ?>>
											No
									  </label>
									</div>
								  </div>
								<!-- Thanksgiving basket?-->
								<div class="control-group">
									<label class="control-label">Would you like to be considered for a Thanksgiving basket from another agency?</label>
									<div class="controls">
									  <label class="radio">
										<input name="thanksgiving_basket" type="radio" id="thanksgiving_basket1" value="1" <?php if($family['thanksgiving_basket'] == '1'){ echo "checked=''";} ?>>
											Yes
									  </label>
									  <div style="clear:both"></div>
									  <label class="radio">
										<input type="radio" name="thanksgiving_basket" id="thanksgiving_basket2" value="0" <?php if($family['thanksgiving_basket'] == '0'){ echo "checked=''";} ?>>
											No
									  </label>
									</div>
								  </div>
								<!-- Food only?-->
								<div class="control-group">
									<label class="control-label">Do you want food only?</label>
									<div class="controls">
									  <label class="radio">
										<input name="food_only" type="radio" id="food_only1" value="1" <?php if($family['food_only'] == '1'){ echo "checked=''";} ?>>
											Yes
									  </label>
									  <div style="clear:both"></div>
									  <label class="radio">
										<input type="radio" name="food_only" id="food_only2" value="0" <?php if($family['food_only'] == '0'){ echo "checked=''";} ?>>
											No
									  </label>
									</div>
								  </div>
								<!-- Other-->							
							    <div class="control-group">
									<label class="control-label" for="focusedInput">Other</label>
								 <div class="controls">
								  <input name="other" class="input-xlarge focused" id="focusedInput" type="text"  value="<?php echo $family['other']; ?>">
								  </div>
							    </div>
							</fieldset>
							
							<fieldset>
							<legend>Member 1</legend>
								<!-- First Name-->							
								  <div class="control-group">
										<label class="control-label" for="focusedInput">First Name</label>
									<div class="controls">
									  <input name="first_name1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['first_name']; ?>">
									</div>
								  </div>
								<!-- Middle Initial-->							
								  <div class="control-group">
										<label class="control-label" for="focusedInput">Middle Initial</label>
									<div class="controls">
									  <input name="middle_initial1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['middle_initial']; ?>">
									</div>
								  </div>
								<!-- Last Name-->
									<div class="control-group">
										<label class="control-label" for="focusedInput">Last Name</label>
									<div class="controls">
									  <input name="last_name1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['last_name']; ?>">
									</div>
								  </div>
								<!-- Gender-->				
								  <div class="control-group">
									<label class="control-label">Gender</label>
									<div class="controls">
									  <label class="radio">
										<input name="gender1" type="radio" id="gender1radio1" value="male" <?php if($member1['gender'] == 'male'){ echo "checked=''";} ?>>
											Male
									  </label>
									  <div style="clear:both"></div>
									  <label class="radio">
										<input type="radio" name="gender1" id="gender1radio2" value="female" <?php if($member1['gender'] == 'female'){ echo "checked=''";} ?>>
											Female
									  </label>
									</div>
								  </div>
								<!-- Date of Birth-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Date of Birth</label>
									<div class="controls">
										<input name="date_of_birth1" type="text" class="input-xlarge datepicker" id="focusedInput" value="<?php echo $member1['date_of_birth']; ?>">
									</div>
								</div>
								<!-- Phone Number -->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">Phone Number</label>
										<div class="controls">
										  <input name="phone_number1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['phone_number']; ?>">
										</div>
									  </div>	
								<!-- Last 4 Social-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Last 4# SSN</label>
									<div class="controls">
										<input name="last_four_SSN1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['last_four_SSN']; ?>">
									</div>
								</div>
								<!-- Relationship-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Relationship</label>
									<div class="controls">
										<input name="relationship1" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member1['relationship']; ?>">
									</div>
								</div>
							</fieldset>
								
							
							<fieldset>
							<legend>Member 2</legend>
								<!-- First Name-->							
								  <div class="control-group">
										<label class="control-label" for="focusedInput">First Name</label>
									<div class="controls">
									  <input name="first_name2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['first_name']; ?>">
									</div>
								  </div>
								<!-- Middle Initial-->							
								  <div class="control-group">
										<label class="control-label" for="focusedInput">Middle Initial</label>
									<div class="controls">
									  <input name="middle_initial2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['middle_initial']; ?>">
									</div>
								  </div>
								<!-- Last Name-->
									<div class="control-group">
										<label class="control-label" for="focusedInput">Last Name</label>
									<div class="controls">
									  <input name="last_name2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['last_name']; ?>">
									</div>
								  </div>
								<!-- Gender-->				
								  <div class="control-group">
									<label class="control-label">Gender</label>
									<div class="controls">
									  <label class="radio">
										<input name="gender2" type="radio" id="gender2radio1" value="male" <?php if($member2['gender'] == 'male'){ echo "checked=''";} ?>>
											Male
									  </label>
									  <div style="clear:both"></div>
									  <label class="radio">
										<input type="radio" name="gender2" id="gender2radio2" value="female" <?php if($member2['gender'] == 'female'){ echo "checked=''";} ?>>
											Female
									  </label>
									</div>
								  </div>
								<!-- Date of Birth-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Date of Birth</label>
									<div class="controls">
										<input name="date_of_birth2" type="text" class="input-xlarge datepicker" id="focusedInput" value="<?php echo $member2['date_of_birth']; ?>">
									</div>
								</div>
								 <!-- Phone Number -->							
									  <div class="control-group">
											<label class="control-label" for="focusedInput">Phone Number</label>
										<div class="controls">
										  <input name="phone_number2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['phone_number']; ?>">
										</div>
									  </div>	
								<!-- Last 4 Social-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Last 4# SSN</label>
									<div class="controls">
										<input name="last_four_SSN2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['last_four_SSN']; ?>">
									</div>
								</div>
								<!-- Relationship-->
								<div class="control-group">
									<label class="control-label" for="focusedInput">Relationship</label>
									<div class="controls">
										<input name="relationship2" class="input-xlarge focused" id="focusedInput" type="text" value="<?php echo $member2['relationship']; ?>">
									</div>
								</div>
							</fieldset>
			  
							  
							  <div class="form-actions">
								<button type="submit" class="btn btn-primary">Save</button>
								<button class="btn" type="reset">Cancel</button>
							  </div>
							</fieldset>
							
							<input type="hidden" name="family_id" id="family_id" value="<?php echo $family_id; ?>">
							
			
						  </form>
					
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
			
    
<?php include('templates/footer.php'); ?>
